<script>
function sleep(time){
    // 请写出你的代码
    return new Promise((resolve, reject) => {
        // setTimeout(() => {
        //     resolve()
        // }, time)

        setTimeout(resolve, time)
    })
    // const p = new Promise((resolve, reject) => {
    //     setTimeout(() => {
    //         resolve()
    //     }, time)
    // })
    // return p

}

sleep(2000).then(()=>{
    console.log("后续操作")
})
console.log(2);
</script>